package cn.s1995.sloth.bizs.mapper;

import cn.s1995.sloth.bizs.entity.Prod;
import cn.s1995.sloth.bizs.oo.req.ProdSearchREQ;
import cn.s1995.sloth.common.data.datascope.SlothBaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;
import java.util.Map;

@Mapper
public interface ProdMapper extends SlothBaseMapper<Prod> {
    /**
     * 更新商品库存
     * @param prod
     * @return
     */
    int updateStocks(@Param("prod") Prod prod);

    /**
     * 归还库存
     * @param collect
     */
    void returnStock(@Param("collect") Map<Long, Integer> collect);

	Page selectProdPage(@Param("page") Page page,@Param("req") ProdSearchREQ req);

    Prod getDeletedProd(Long id);

    Page getPage(@Param("page") Page page, @Param("req") ProdSearchREQ req);

    List getList(@Param("req") ProdSearchREQ req);
}
